<%@ page language="java" contentType="text/html; charset=utf-8"
		 pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>后台管理 - 易买网</title>
	<link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/static/css/style.css" />
	<script type="text/javascript" src="${pageContext.request.contextPath}/static/scripts/jquery.min.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/static/scripts/My97DatePicker/WdatePicker.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/static/scripts/function.js"></script>
</head>
<body>
<jsp:include page="top.jsp" />
<div id="main" class="wrap">
	<jsp:include page="leftbar.jsp" />
	<div class="main">
		<h2>商品管理</h2>
		<div class="manage">
			<div class="search">
				<form method="post" action="${pageContext.request.contextPath}/product/selectProduct">
					所属分类：<c:out value="${product.name}"/>
					<select name="category" id="category">
						<c:forEach items="${categories}" var="c">
							<c:if test="${!c.epcId.equals(c.epcParentId)}"><option value="${c.epcName}"  </c:if><c:if test="${c.epcName.equals(category)}">selected="selected" </c:if>>${c.epcName}</option>
						</c:forEach>
					</select>

					商品名称：<input type="text" class="text" name="fileName" id="fileName" value="<c:out value="${fileName}"/>" />
					<label class="ui-blue"><input type="submit" name="submit"
												  value="查询" />
					</label>
				</form>
			</div>
			<div class="spacer"></div>
			<table class="list">
				<c:if test="${products==null || products.size()==0}">
					无符合此条件的商品！
				</c:if>
				<c:if test="${products!=null && products.size()>0}">
					<tr>
						<th>编号</th>
						<th>商品名称</th>
						<th>操作</th>
					</tr>
				</c:if>

				<c:forEach items="${products}" var="product">
					<c:set var="i" value="${i+1}"></c:set>
					<tr>
						<td class="first w4 c"><c:out value="${i}" />
						</td>
						<td class="thumb"><img style="width: 100px;height: 100px" src="${pageContext.request.contextPath}/static/files/${product.epFileName}" /><a
								href="${pageContext.request.contextPath}/product/readProduct?entityId=${product.epId}"><c:out value="${product.epName}" />
						</a>
						</td>
						<td class="w1 c"><a href="${pageContext.request.contextPath}/product/readProduct?entityId=${product.epId}">修改</a>
							<div class="manageDel">
								<a  href="${pageContext.request.contextPath}/product/delProduct?entityId=${product.epId}">删除</a></div>
						</td>
					</tr>
				</c:forEach>
			</table>
			<div class="pager">
				<ul class="clearfix">
<%--					<c:if test="${pager.pageCount>1}">--%>
<%--						<li><a href="ProductServlet?page=1&category=${product.epName}&fileName=${product.epFileName}">首页</a></li>--%>
<%--						<c:choose>--%>
<%--							<c:when test="${pager.currentPage>=3}">--%>
<%--								<li>...</li>--%>
<%--								<li class="current"><a href="ProductServlet?page=<c:out value='${pager.currentPage-1}'/>&category=${product.epName}&fileName=${product.epFileName}">--%>
<%--									<c:out value="${pager.currentPage-1}" /></a></li>--%>
<%--							</c:when>--%>
<%--							<c:when test="${pager.currentPage>=2}">--%>
<%--								<li class="current"><a href="ProductServlet?page=<c:out value='${pager.currentPage-1}'/>&category=${product.epName}&fileName=${product.epFileName}">--%>
<%--									<c:out value="${pager.currentPage-1}" /></a></li>--%>
<%--							</c:when>--%>
<%--						</c:choose>--%>

<%--						<li class="current"><c:out value="${pager.currentPage}" /></li>--%>

<%--						<c:choose>--%>
<%--							<c:when test="${pager.currentPage+1<pager.pageCount}">--%>
<%--								<li><a href="ProductServlet?page=<c:out value='${pager.currentPage+1}'/>&category=${product.epName}&fileName=${product.epFileName}"><c:out value="${pager.currentPage+1}" /></a></li>--%>
<%--								<li>...</li>--%>
<%--							</c:when>--%>
<%--							<c:when test="${pager.currentPage+1<=pager.pageCount}">--%>
<%--								<li><a href="ProductServlet?page=<c:out value='${pager.currentPage+1}'/>&category=${product.epName}&fileName=${product.epFileName}"><c:out value="${pager.currentPage+1}" /></a></li>--%>
<%--							</c:when>--%>
<%--						</c:choose>--%>
<%--						<li><a href="ProductServlet?page=<c:out value='${pager.pageCount}'/>&category=${product.epName}&fileName=${product.epFileName}">尾页</a></li>--%>
<%--					</c:if>--%>
				</ul>
			</div>
		</div>
	</div>
	<div class="clear"></div>
</div>
<div id="footer">Copyright &copy;  XXX All Rights Reserved.
	京ICP证1000001号</div>
</body>
</html>
